package com.atguigu.crowd.service.api;

import com.atguigu.crowd.entity.Role;
import com.github.pagehelper.PageInfo;

import java.util.List;

/**
 * @author zzqstart
 * @Description
 * @date 2022-09-03 20:52
 */
public interface RoleService {

    /**
     * @Description 分页、关键字查询
     * 
     * @Author zzqstart
     * @Date 2022/9/3 21:13
     * @Param [keyword, pageNum, pageSize]
     * @return com.github.pagehelper.PageInfo<com.atguigu.crowd.entity.Role>
     **/
    PageInfo<Role> getRolePage(String keyword, Integer pageNum, Integer pageSize);

    /**
     * @Description 添加role
     *
     * @Author zzqstart
     * @Date 2022/9/4 15:56
     * @Param [roleName]
     * @return void
     **/
    void saveRole(Role role);

    /**
     * @Description 更新role
     *
     * @Author zzqstart
     * @Date 2022/9/4 18:48
     * @Param [role]
     * @return void
     **/
    void editRole(Role role);

    /**
     * @Description 根据list删除role
     *
     * @Author zzqstart
     * @Date 2022/9/5 0:18
     * @Param [list]
     * @return void
     **/
    void remove(List<Integer> list);

    /**
     * @Description 根据adminId查找哪些角色已分配给该admin
     *
     * @Author zzqstart
     * @Date 2022/9/6 2:16
     * @Param [adminId]
     * @return java.util.List<com.atguigu.crowd.entity.Role>
     **/
    List<Role> getAssignedRole(Integer adminId);

    /**
     * @Description 根据adminId查找哪些未角色已分配给该admin
     *
     * @Author zzqstart
     * @Date 2022/9/6 2:17
     * @Param [adminId]
     * @return java.util.List<com.atguigu.crowd.entity.Role>
     **/
    List<Role> getUnAssignedRole(Integer adminId);

    /**
     * @Description 修改用户角色
     *
     * @Author zzqstart
     * @Date 2022/9/6 15:22
     * @Param [adminId, roleIdList]
     * @return void
     **/
    void saveAdminRoleRelationship(Integer adminId, List<Integer> roleIdList);

}
